package day3;

import java.util.Arrays;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;

public class demo3 {
    public static void main1(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int k=scanner.nextInt();
        int ret=0;
        PriorityQueue<Integer>queue=new PriorityQueue<>(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2-o1;
            }
        });
        for (int i = 0; i <n ; i++) {
            int x=scanner.nextInt();
            if (x%2!=0)ret+=x;
            else queue.offer(x);
        }

        for (int i = 0; i <k ; i++) {
            if(queue.isEmpty())break;
int x=queue.poll();
x/=2;
if(x%2!=0){
    ret+=x;
}else {
    queue.offer(x);
}
        }
while (!queue.isEmpty()){
    ret+=queue.poll();
}
        System.out.println(ret);
    }

    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int k=scanner.nextInt();
        int ret=0;
int []arr=new int[n];
int j=0;
        int k1=0;
        for (int i = 0; i <n ; i++) {
            int x=scanner.nextInt();
            if (x%2!=0)ret+=x;
           else arr[j++]=x;
        }
j--;
        for (int i = 0; i <k ; i++) {
            if(j==-1)break;
            Arrays.sort(arr);
    int t=arr[j]/2;
    if (t%2!=0){
        ret+=t;
        j--;
    }
    else arr[j]=t;
        }
        for (int i = 0; i <=j ; i++) {
            ret+=arr[j];
        }
        System.out.println(ret);


    }



}
